﻿@model UserViewModel
	<form class="layui-form" asp-controller="User" asp-action="UserEdit" method="post">
		<div class="layui-card">
			<div class="layui-card-header layui-elem-quote">会员信息</div>
			<div class="layui-card-body">
				<div class="layui-form-item">
					<label class="layui-form-label">会员组</label>
					<div class="layui-input-block">
						<span class="select-box radius">
							<select id="GroupID" class="layui-input" asp-for="Users.GroupID" data-val="true" data-val-required="不能为空" lay-ignore></select>
						</span>
						<span asp-validation-for="Users.GroupID" style="color:red;"></span>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><span class="c-red">*</span>会员名</label>
					<div class="layui-input-block">
						@{
							if (Model.id <= 0)
							{
								<input type="text" class="layui-input" asp-for="Users.UserName" data-val="true" data-val-required="不能为空">
								<span asp-validation-for="Users.UserName" style="color:red;"></span>
							}
							else
							{
								<input type="text" readonly="readonly" class="layui-input layui-disabled" asp-for="Users.UserName">
							}
						}
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><span class="c-red">*</span>密码</label>
					<div class="layui-input-block">
						@{
							if (Model.id <= 0)
							{
								<input type="password" class="layui-input" asp-for="Users.UserPassword" data-val="true" data-val-required="不能为空">
								<span asp-validation-for="Users.UserPassword" style="color:red;"></span>
							}
							else
							{
								<input type="password" class="layui-input" id="UsersEntity_UserPassword" name="UsersEntity.UserPassword">
								<span style="color:red;">不修改请留空</span>
							}
						}
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><span class="c-red"></span>会员头像</label>
					<div class="layui-input-block">
						@await Component.InvokeAsync("MorePic", new MorePicViewModel { Prefix = "ctlUserFace", PhotoPathList = Model.Users.UserFace, FileNumLimit = 1 })
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">会员签名</label>
					<div class="layui-input-block">
						<textarea class="layui-textarea" asp-for="Users.Sign"></textarea>
					</div>
				</div>
			</div>
		</div>
		<div class="layui-card">
			<div class="layui-card-header layui-elem-quote">个人信息</div>
			<div class="layui-card-body">
				<div class="layui-form-item">
					<label class="layui-form-label">姓名</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.TrueName">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">称谓</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.Title" placeholder="例：李总">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">通讯区域</label>
					<div class="layui-input-block">
						@await Component.InvokeAsync("Region", new RegionViewModel { Prefix = "ctlContacter", Province = Model.Contacter.Province, City = Model.Contacter.City, Area = Model.Contacter.Area })
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">详细地址</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.Address">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">邮政编码</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.ZipCode">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">手机号码</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.Mobile" data-val="true" data-val-regex="格式不对" data-val-regex-pattern="@{@RegexHelper.MobilePattern}">
						<span asp-validation-for="Contacter.Mobile" style="color:red;"></span>
					</div>
				</div>
				<div class="layui-form-item layui-hide">
					<label class="layui-form-label">住宅电话</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.HomePhone">
					</div>
				</div>
				<div class="layui-form-item layui-hide">
					<label class="layui-form-label">办公电话</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.OfficePhone">
					</div>
				</div>
				<div class="layui-form-item layui-hide">
					<label class="layui-form-label">传真号码</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.Fax">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">Email</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.Email" data-val="true" data-val-regex="格式不对" data-val-regex-pattern="@{@RegexHelper.EmailPattern}">
						<span asp-validation-for="Contacter.Email" style="color:red;"></span>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">QQ</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.QQ">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">微信</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.ICQ">
					</div>
				</div>
				<div class="layui-form-item layui-hide">
					<label class="layui-form-label">个人主页</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.Homepage">
					</div>
				</div>
				<div class="layui-form-item layui-hide">
					<label class="layui-form-label">紧急联系人1</label>
					<div class="layui-input-block">
						<div class="layui-col-xs3 layui-col-sm3 layui-col-md3">
							姓名<input type="text" class="layui-input" asp-for="EmergencyContactList[0].Name">
						</div>
						<div class="layui-col-xs3 layui-col-sm3 layui-col-md3">
							电话<input type="text" class="layui-input" asp-for="EmergencyContactList[0].Tel">
						</div>
						<div class="layui-col-xs3 layui-col-sm3 layui-col-md3">
							身份证<input type="text" class="layui-input" asp-for="EmergencyContactList[0].IdCard">
						</div>
						<div class="layui-col-xs3 layui-col-sm3 layui-col-md3">
							与本人关系<input type="text" class="layui-input" asp-for="EmergencyContactList[0].Relationship">
						</div>
						<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
							家庭住址<input type="text" class="layui-input" asp-for="EmergencyContactList[0].HomeAddress">
						</div>
						<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
							单位名称<input type="text" class="layui-input" asp-for="EmergencyContactList[0].CompanyName">
						</div>
						<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
							单位地址<input type="text" class="layui-input" asp-for="EmergencyContactList[0].CompanyAddress">
						</div>
					</div>
				</div>
				<div class="layui-form-item layui-hide">
					<label class="layui-form-label">紧急联系人2</label>
					<div class="layui-input-block">
						<div class="layui-col-xs3 layui-col-sm3 layui-col-md3">
							姓名<input type="text" class="layui-input" asp-for="EmergencyContactList[1].Name">
						</div>
						<div class="layui-col-xs3 layui-col-sm3 layui-col-md3">
							电话<input type="text" class="layui-input" asp-for="EmergencyContactList[1].Tel">
						</div>
						<div class="layui-col-xs3 layui-col-sm3 layui-col-md3">
							身份证<input type="text" class="layui-input" asp-for="EmergencyContactList[1].IdCard">
						</div>
						<div class="layui-col-xs3 layui-col-sm3 layui-col-md3">
							与本人关系<input type="text" class="layui-input" asp-for="EmergencyContactList[1].Relationship">
						</div>
						<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
							家庭住址<input type="text" class="layui-input" asp-for="EmergencyContactList[1].HomeAddress">
						</div>
						<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
							单位名称<input type="text" class="layui-input" asp-for="EmergencyContactList[1].CompanyName">
						</div>
						<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
							单位地址<input type="text" class="layui-input" asp-for="EmergencyContactList[1].CompanyAddress">
						</div>
					</div>
				</div>
				@{
					if (Model.ContacterOptionFieldList != null)
					{
						foreach (var item in Model.ContacterOptionFieldList)
						{
							@await Component.InvokeAsync("FieldControl", new FieldControlViewModel { Prefix = "Contacter", ModelID = 100, IsAdminManage = true, DataSource = Model.ContacterOption, FieldName = item.FieldName, FieldValue = item.DefaultValue, FieldType = item.FieldType, FieldLevel = item.FieldLevel, FieldAlias = item.FieldAlias, Tips = item.Tips, Description = item.Description, Disabled = item.Disabled, EnableNull = item.EnableNull, Settings = item.Settings })
						}
					}
				}
			</div>
		</div>
		<div class="layui-card layui-hide">
			<div class="layui-card-header layui-elem-quote">其他信息</div>
			<div class="layui-card-body">
				<div class="layui-form-item">
					<label class="layui-form-label">身份证号</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.IDCard" data-val="true" data-val-regex="格式不对" data-val-regex-pattern="@{@RegexHelper.IdCardPattern}">
						<span asp-validation-for="Contacter.IDCard" style="color:red;"></span>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">身份证图片</label>
					<div class="layui-input-block">
						@await Component.InvokeAsync("MorePic", new MorePicViewModel { Prefix = "ctlIDCardPic", PhotoPathList = Model.Contacter.IDCardPic, FileNumLimit = 2 })
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">户籍区域</label>
					<div class="layui-input-block">
						@await Component.InvokeAsync("Region", new RegionViewModel { Prefix = "ctlIDCardRegion", Province = Model.Contacter.IDCardProvince, City = Model.Contacter.IDCardCity, Area = Model.Contacter.IDCardArea })
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">户籍地址</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.IDCardAddress">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">开户行卡号</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.BankCard">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">银行卡图片</label>
					<div class="layui-input-block">
						@await Component.InvokeAsync("MorePic", new MorePicViewModel { Prefix = "ctlBankCardPic", PhotoPathList = Model.Contacter.BankCardPic, FileNumLimit = 2 })
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">开户行名称</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.BankName">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">持卡人姓名</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.BankAccount">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">出生日期</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" placeholder="yyyy-MM-dd" asp-for="Contacter.Birthday">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">籍贯</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.NativePlace">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">民族</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.Nation">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">性别</label>
					<div class="layui-input-block">
						<select class="layui-input" asp-for="Contacter.Sex">
							<option value="1">男</option>
							<option value="2">女</option>
						</select>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">婚姻</label>
					<div class="layui-input-block">
						<select class="layui-input" asp-for="Contacter.Marriage">
							<option value="0">保密</option>
							<option value="1">未婚</option>
							<option value="2">已婚</option>
							<option value="3">离异</option>
						</select>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">学历</label>
					<div class="layui-input-block">
						<select class="layui-input" asp-for="Contacter.Education" asp-items="ViewBag.EducationList"></select>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">毕业学校</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.GraduateFrom">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">月收入</label>
					<div class="layui-input-block">
						<select class="layui-input" asp-for="Contacter.Income" asp-items="ViewBag.IncomeList"></select>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">生活爱好</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.InterestsOfLife">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">文化爱好</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.InterestsOfCulture">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">娱乐爱好</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.InterestsOfAmusement">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">体育爱好</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.InterestsOfSport">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">其他爱好</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.InterestsOfOther">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">家庭情况</label>
					<div class="layui-input-block">
						<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
							家庭人口数<input type="text" class="layui-input" asp-for="FamilyEntity.Num">
						</div>
						<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
							家庭电话<input type="text" class="layui-input" asp-for="FamilyEntity.Tel">
						</div>
						<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
							家庭地址<input type="text" class="layui-input" asp-for="FamilyEntity.Address">
						</div>
						<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
							邮政编码<input type="text" class="layui-input" asp-for="FamilyEntity.ZipCode">
						</div>
						<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
							家庭月收入<input type="text" class="layui-input" asp-for="FamilyEntity.Income">
						</div>
						<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
							人均月收入<input type="text" class="layui-input" asp-for="FamilyEntity.AveIncome">
						</div>

					</div>
				</div>
				
			</div>
		</div>
		<div class="layui-card layui-hide">
			<div class="layui-card-header layui-elem-quote">工作信息</div>
			<div class="layui-card-body">
				<div class="layui-form-item">
					<label class="layui-form-label">单位名称</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.Company">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">所属部门</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.Department">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">职位</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.Position">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">负责业务</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.Operation">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">单位规模</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.CompanySize">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">单位类型</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.CompanyType">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">单位地址</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" asp-for="Contacter.CompanyAddress">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">单位行业</label>
					<div class="layui-input-block">
						<select class="layui-input" asp-for="Contacter.CompanyIndustry">
							<option value="">请选择</option>
							<option value="农、林、牧、渔业">农、林、牧、渔业</option>
							<option value="采掘业">采掘业</option>
							<option value="制造业">制造业</option>
							<option value="电力、燃气及水的生产和供应业">电力、燃气及水的生产和供应业</option>
							<option value="建筑业">建筑业</option>
							<option value="交通运输、仓储和邮政业">交通运输、仓储和邮政业</option>
							<option value="信息传输、计算机服务和软件业">信息传输、计算机服务和软件业</option>
							<option value="批发和零售业">批发和零售业</option>
							<option value="住宿和餐饮业">住宿和餐饮业</option>
							<option value="房地产业">房地产业</option>
							<option value="租赁和商务服务业">租赁和商务服务业</option>
							<option value="科学研究、技术服务业和地质勘察业">科学研究、技术服务业和地质勘察业</option>
							<option value="水利、环境和公共设施管理业">水利、环境和公共设施管理业</option>
							<option value="居民服务和其他服务业">居民服务和其他服务业</option>
							<option value="教育">教育</option>
							<option value="卫生、社会保障和社会福利业">卫生、社会保障和社会福利业</option>
							<option value="文化、体育和娱乐业">文化、体育和娱乐业</option>
							<option value="公共管理和社会组织">公共管理和社会组织</option>
							<option value="国际组织">国际组织</option>
							<option value="未知">未知</option>
						</select>
					</div>
				</div>
			</div>
		</div>
		@{
			if (Model.ShowCompany)
			{
				<div class="layui-card">
					<div class="layui-card-header layui-elem-quote">所属商户</div>
					<div class="layui-card-body">
						@await Component.InvokeAsync("CompanyEdit", new CompanyViewModel { Company = Model.Company, CompanyOption = Model.CompanyOption, CompanyOptionFieldList = Model.CompanyOptionFieldList })
					</div>
				</div>
			}
		}
	<center>
		<button type="submit" class="layui-btn layuiadmin-btn-list" lay-submit lay-filter="">保存</button>
		<button type="button" class="layui-btn layuiadmin-btn-list" onclick="layer_close()">取消</button>
		<input type="hidden" asp-for="id" />
		<input type="hidden" asp-for="Action" />
		<span style="color:red; font-size:18px;">@Html.ValidationSummary(true)</span>
	</center>
		@Html.AntiForgeryToken()
	</form>
@section scripts{
	<script type="text/javascript">
		layui.use(['form', 'laydate'], function () {
			var laydate = layui.laydate;
			var form = layui.form;

			laydate.render({
				elem: '#Contacter_Birthday'
			});
		});
		$(function () {
			loadUserGroupsAjax("GroupID", "@Model.Users.GroupID", false);
		});
	</script>
}